<!-- box menu -->
<?php $this->renderPartial("application.views.layouts._menu");?>
<!-- End box menu -->
<?php     
    $action = Yii::app()->controller->action->id;
    $html = "";
    foreach($items as $key=>$value){
        $item = $value; 
        break;
    }
?>    
<style>
.emb-code .style_tab {
    border-bottom: 1px solid #DDDDE5;
    height: 30px;
}
.item, .add_banner li:last-child, .mag-btt10, .cont-news p, #footer .box p, .emb-code .style_tab, .list_link li, .adm_banner li {
    margin-bottom: 10px;
}
.style_tab {
    height: 15px;
}
.tab-script {
    left: 77px !important;
}
.tab-bortop a {
    color: #333333;
}
.tab-bortop:hover, .tab-bortop.active {
    border-top: 2px solid #FF9900 !important;
}
.tab-bortop:hover a, .tab-bortop.active a, .view_more a:hover, .bulet2 a:hover {
    color: #006FBC !important;
}
ul {
    list-style: none outside none;
    margin: 0;
    padding: 0;
}
.tab-bortop {
    border-top: 2px solid rgb(0, 111, 188) !important;
    position: absolute;
    display: inline-block;
    border-left: 1px solid rgb(221, 221, 229);
    border-right: 1px solid rgb(221, 221, 229);
    font-size: 16px;
    padding: 7px 20px;
    background: none repeat scroll 0% 0% rgb(255, 255, 255);
    top: -4px;
    left: 0px;
}
.relative {
    position: relative;
}
</style>
<script type="text/javascript">
function showForm(divId1, divId2){
    $("#" + divId1).show();
    $("#show_" + divId1).addClass("active");
    $("#" + divId2).hide();
    $("#show_" + divId2).removeClass("active");
}
</script> 
 <div class="about">
        <?php $this->widget("BoxLogin");?>
        <h1><a><img src="<?php echo Yii::app()->params['static_url'];?>images/tenweb-icon-taomanhung.png" alt="" class="kc_TB_td" /></a><a href="#" class="xanhdam">Tự Tạo Mã Nhúng</a>
        </h1>
        <div class="Tma">
        <div class="Tma_1">
            <a href="#" class="button_Tma_2">1</a><a href="#" class="denxam">Chọn sản phẩm</a>
            &nbsp;&nbsp;&nbsp;
            <a href="#" class="button_Tma_2">2</a><a href="#" class="denxam">Chọn kiểu hiện thị</a>
            &nbsp;&nbsp;&nbsp;
            <a href="#" class="button_Tma_2">3</a><a href="#" class="denxam">Chọn giao diện</a>
            &nbsp;&nbsp;&nbsp;
            <a href="#" class="button_Tma">4</a><a href="#" class="denxam">Lấy mã nhúng</a>
        </div>
        </div>
         <div>
            <h2><img src="<?php  echo Yii::app()->params['static_url']; ?>images/tenweb-icon-taomanhung-giaodien.png" alt="" width="14" height="16" class="kc_TB_td" />Chọn Giao Diện</h2>  
    </div>
         <div class="Tma">
         <div style="background-color: #ffffff;padding: 10px;">
                    <p style="padding: 5px;"><strong>Tiêu đề:<?php echo $data_embed["title"]?></strong></p>
                    <div>
                        <ul>
                            <li>
                                <div>
                                    <?php $this->renderPartial("tpl_display_code_tmp",array("item"=>$item,"type"=>$type_display,"radio"=>0,"layout"=>$layout))?> 
                                </div>
                            </li>
                        </ul>
                        <p><strong>Lấy mã nhúng wap/web ở bên dưới</strong></p><br/>
                        <div>
                            <ul >
                                <li class="emb-code">
                                    <div class="style_tab relative">
                                        <span id="show_form_html" class="tab-bortop"><a href="javascript:void(0)" onclick="showForm('form_html','form_javascript');">Html</a></span>
                                        <span id="show_form_javascript" class="tab-bortop tab-script active"><a href="javascript:void(0)" onclick="showForm('form_javascript','form_html');">Script</a></span>
                                    </div> 
                                </li>                       
                            </ul>
                            <ul id="form_javascript">
                                <li>
                                    <p><strong>Mã nhúng javascript hiển thị ngẫu nhiên các game</strong></p>
                                    <p>Mã nhúng xuất hiện ngẫu nhiên các game tương thích với mọi loại trình duyệt</p>
                                    <div >  
                                    <?php if($action !="codeDetailAdmin"){
                                        
                                         $link_adv = Yii::app()->params["url_hayquadi"].Url::createUrl("tool/viewEmbedUser",array("embed_id"=>$data_embed["id"],"domain"=>$_SESSION["username"]));
                                        ?>
                                        <textarea rows="2" id="text_js" style="width: 95%; text-align: left;color: black;overflow:hidden;" onclick="this.select();" onmousedown="this.select();"><script language="javascript">document.write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8" \/>');document.write('<script src="<?php echo $link_adv;?>"><\/script>');</script></textarea>
                                    <?php }else{      
                                        $link_adv = Yii::app()->params["url_hayquadi"].Url::createUrl("tool/viewEmbedUser",array("embed_id"=>$data_embed["id"],"domain"=>$_SESSION["username"]));
                                       
                                        $html_no_script = "";
                                        ?>
                                        <textarea rows="2" id="text_js" style="width: 95%; text-align: left;color: black;overflow:hidden;" onclick="this.select();" onmousedown="this.select();"><script language="javascript">document.write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8" \/>');document.write('<script src="<?php echo $link_adv;?>"><\/script>');</script><?php echo $html_no_script;?></textarea>                        
                                    <?php }?>
                                    </div>
                                </li>                       
                            </ul>
                            <ul  id="form_html" style="display: none;">
                                <?php foreach($items as $key=>$value){
                                    if(isset($value["id"])){
                                    ?>
                                    <li>
                                        <div>
                                            <?php 

                                                $this->renderPartial("tpl_display_code_tmp",array("item"=>$value,"type"=>$type_display,"radio"=>0,"layout"=>$layout));
                                                $html = $this->renderPartial("tpl_display_code_tmp",array("item"=>$value,"type"=>$type_display,"radio"=>0,"layout"=>$layout),true);
                                                $html = '<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>'.$html;
                                                $html = Common::sanitize_output($html);    
                                            ?> 
                                            <div > Mã nhúng:
                                                <textarea rows="2" id="text_select_<?php echo $key;?>" style="width: 99%; text-align: left;overflow:hidden;" onclick="this.select();" onmousedown="this.select();"><?php echo $html;?></textarea>
                                            </div>
                                        </div>
                                    </li>
                                    <?php }
                                }?>
                            </ul>
                        </div>
                    </div>
</div>            
            
<script type="text/javascript">
$('textarea').mouseup(function(e){e.preventDefault();}).focus(function(e){$(this).select();}).click(function(e){$(this).select();});
</script>        
